<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script>
		var n = 3;
		var obj = {
		   n:2,  //6
		   fn:(function(){
		       this.n += 2; // 5
		       n = n * 3;
		       var n = 4;  // 4
		       return function(){
		           this.n *= 3;  //15
		           n *= 2;
		           alert(n); // 8
		       }
			})()
		};


		var fn = obj.fn;
		alert(n);        //  5
		fn();            //  8
		obj.fn();        //  16
		alert(window.n); //  15
		alert(obj.n);    //  6




	</script>
</body>
</html>